﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Sgr.UPMS.Domain.Organizations
{
    /// <summary>
    /// 邀请码验证结果
    /// </summary>
    public class InvitationValidationResult
    {
        /// <summary>
        /// 邀请信息
        /// </summary>
        public OrganizationInvitation? Invitation { get; }

        /// <summary>
        /// 是否验证通过
        /// </summary>
        public bool IsValid => Invitation != null && Invitation.IsValid() && Invitation.OrganizationId > 0;

        /// <summary>
        /// 构造函数
        /// </summary>
        public InvitationValidationResult(OrganizationInvitation? invitation)
        {
            Invitation = invitation;
        }
    }
}